<template>
  <div class="news">
  <!-- 导航区 -->
    <ul>
      <li v-for="item in newList" :key="item.id">
        <RouterLink :to="{name:'Detail'}">{{ item.title }}</RouterLink>
      </li>
    </ul>
    <!-- 展示区 -->
    <div class="news-content">
      <RouterView></RouterView>
    </div>
  </div>
</template>

<script setup lang="ts" name="News">
import { reactive } from "vue";
import {RouterView,RouterLink} from "vue-router";

const newList = reactive([
  {
    id: "qazwsx1",
    title: "新闻001",
    content: "新闻001的内容",
  },
  {
    id: "qazwsx2",
    title: "新闻002",
    content: "新闻002的内容",
  },
  {
    id: "qazwsx3",
    title: "新闻003",
    content: "新闻003的内容",
  },
  {
    id: "qazwsx4",
    title: "新闻004",
    content: "新闻004的内容",
  },
]);
</script>

<style scoped>
/* 新闻 */
.news {
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  height: 100%;
}
.news ul {
  margin-top: 30px;
  list-style: none;
  padding-left: 10px;
}
.news li > a {
  font-size: 18px;
  line-height: 40px;
  text-decoration: none;
  color: #64967e;
  text-shadow: 0 0 1px rgb(0, 84, 0);
}
.news-content {
  width: 70%;
  height: 90%;
  border: 1px solid;
  margin-top: 20px;
  border-radius: 10px;
}
</style>
